<template>
  <div>
    <h1>这个api测试页面</h1>
    <!--<router-link to="/">登录</router-link>-->
        <!-- <i class="el-icon-success" :style="{ color: iconColor }" />
    <i class="el-icon-success"  style="color:blue;font-size:100px"></i> -->
    <el-button type="danger" @click="fun1">退出登录</el-button>
    <el-button type="danger" @click="fun2">注册用户</el-button>
    <el-button type="danger" @click="fun3">禁止用户</el-button>
    <el-button type="danger" @click="fun4">激活用户</el-button>
    <el-button type="danger" @click="fun5">修改用户信息</el-button>
    <el-button type="danger" @click="fun6">修改用户密码</el-button>
    <el-button type="danger" @click="fun7">用户设置表数据</el-button>
    <el-button type="danger" @click="fun8">根据用户设置表去查数据</el-button>
    <el-button type="danger" @click="fun9">根据用户输入表的名字查询用户输入表信息</el-button>
    <el-button type="danger" @click="fun10">单元查询用户输入表生成表信息</el-button>
    <el-button type="danger" @click="fun11" style="font">激活用户表</el-button>
    <el-button type="danger" @click="fun12">禁用用户表</el-button>
    <el-button type="danger" @click="fun13">查询生成表的历史纪录</el-button>
  </div>
</template>

<script>


export default {
  name: "test",
  data() {
      return {

          iconColor: "red",
      }
  },
  methods: {
    onColorChange() {
        this.iconColor = 'green'
        },
    async fun1() {
      const { data: res } = await this.$http.post("logout");
      console.log(res);
    },
    async fun2() {
      const { data: res } = await this.$http.post("register", {
        userName: "前端测试",
        password: "123456",
        remark: "hello",
      });
      console.log(res);
    },
    async fun3() {
      const { data: res } = await this.$http.put("disable/前端测试", {
        a: 1,
        b: 2,
      });
      console.log(res);
    },
    async fun4() {
      // const name = sessionStorage.getItem("userNamr");
      // const { data: res } = await this.$http.put(
      //   `/manager/user/enable/${name}`
      // );
      const { data: res } = await this.$http.post(`user/enable`,
      {
        "userName":"lyh5",
        "password":""
      });
      console.log(res);
    },
    async fun5() {
      // axios.get('/login').then((data)=>{
      //   console.log(data)
      // })

      // const data = await axios.get('/login')/
      // console.log(data)

      const { data: res } = await this.$http.put("personInfo/update", {
        userName: "前端测试",
        companyID: "123456",
        remark: "我就是被测试的",
      });

      // const { data: res } = await this.$http.put("personInfo/update",
      //     {
      //         "userName":"前端测试",
      //         "companyID":"123456",
      //         "remark":"我就是被测试的"
      //     }
      // );
      console.log(res);
    },
    async fun6() {
      const { data: res } = await this.$http.put("password/update", {
        oldPassword: "123456",
        newPassword: "1234567",
      });
      console.log(res);
    },
    async fun7(){
        const { data: res } = await this.$http.post("devicedata/UserInputData", {
        "name":"夹具9",
        "startadd":"E10_10000",
        "length":"32",    // 长度要精确
        "endadd":"E10_11115",
        "eid":"2",
        "tid":"1"
      });
      console.log(res);
    },
    async fun8(){
        const { data: res } = await this.$http.post("devicedata/UserQueryInputDataLine", {
        "name":"夹具5",
        "startadd":"E10_00000",
        "length":"8",    // 长度要精确
        "endadd":"E10_00008",
        "eid":"2",
        "tid":"1"
      });
      console.log(res);
    },
    async fun9(){
        const { data: res } = await this.$http.post("devicedata/UserQueryInputDataByName", {
        "name":"夹具5",
      });
      console.log(res);
    },
    async fun10(){
        const { data: res } = await this.$http.post("devicedata/QueryUserInputTabelName", {
        "id":"",
        "InputName":"",
        "TableName":"",
        "status":""
      });
      console.log(res);
    },
    async fun11(){
        const { data: res } = await this.$http.post("devicedata/EnableUserInputTabel", {
        "name":"夹具4"
      });
      console.log(res);
    },
    async fun12(){
        const { data: res } = await this.$http.post("devicedata/DisableUserInputTabel", {
        "name":"夹具4"
      });
      console.log(res);
    },
    async fun13(){
        const { data: res } = await this.$http.post("devicedata/QueryTableDataHistory", {
        "BeginTime": "2022-2-01 00:00:00",
        "EndTime": "2022-3-29 00:00:00",
        "tablename":"linyou2022_03_11_22_58"
      });
      console.log(res);
    }
  },
};
</script>

<style scoped>
.el-button{
  margin-top: 20px;
}
</style>
